//电子邮件puhalskijsemen@gmail.com
//源码网站 开vpn全局模式打开 http://web3incubators.com/
//电报https://t.me/gamecode999
var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
    })(e, t);
}, function(e, t) {
    function r() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, 
    new r());
}), a = this && this.__decorate || function(e, t, o, r) {
    var n, i = arguments.length, c = i < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, o) : r;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(e, t, o, r); else for (var a = e.length - 1; 0 <= a; a--) (n = e[a]) && (c = (i < 3 ? n(c) : 3 < i ? n(t, o, c) : n(t, o)) || c);
    return 3 < i && c && Object.defineProperty(t, o, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("GameManager"), s = cc._decorator, c = s.ccclass, l = s.property, d = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.camera = null, e.time = 0, e.spriteFrame = new cc.SpriteFrame(), e;
    }
    return i(e, t), e.prototype.refresh = function() {
        var e, t, o, n = r.default.getInstance().gameView;
        n && 0 < n.players.filter(function(e) {
            return "role" == e.node.group;
        }).length && (this.node.setPosition(n.followCamera.node.getPosition()), (e = n.getSprite()).scaleY = -1, 
        e.opacity = 100, e.angle = 0, e.active = !0, e.zIndex = n.curPlayer.node.zIndex - 2, 
        e.setContentSize(+cc.winSize.width / this.camera.zoomRatio, +cc.winSize.height / this.camera.zoomRatio), 
        e.setPosition(n.followCamera.node.getPosition()), e.parent = n.layout, (t = new cc.RenderTexture()).initWithSize(e.width, e.height), 
        this.spriteFrame.setTexture(t), this.camera.targetTexture = t, (o = e.getComponent(cc.Sprite)).spriteFrame = this.spriteFrame, 
        cc.tween(o.node).to(.6, {
            opacity: 0
        }).call(function() {
            t = null, n ? o && n.removeSprite(o.node) : o.node.destroy();
        }).start());
    }, e.prototype.update = function(e) {
        this.time += e, .05 <= this.time && (this.time = 0, this.refresh());
    }, a([ l(cc.Camera) ], e.prototype, "camera", void 0), a([ c ], e);
}(cc.Component);

n.default = d;